package com.bolt.auth.admin.api.sys.dto;

import com.bolt.common.collection.IteratorUtil;
import com.bolt.common.reflect.ObjectUtil;
import com.bolt.common.utils.StrUtil;
import com.bolt.support.query.conditions.domain.MatchType;
import com.bolt.support.spring.jpa.annotation.Filter;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class OrgQueryCriteria {

    @Filter(type = MatchType.BW)
    private String name;

    @Filter(type = MatchType.EQ)
    private Boolean enabled;

    @Filter(type = MatchType.BT)
    private List<Date> createDate;

    @Filter
    private String pid;

    @Filter(type = MatchType.NU,name = "pid")
    private Boolean pidIsNull;


    public boolean isQuery(){
        return ObjectUtil.isNotNull(pid ) || StrUtil.isNotBlank(name)|| ObjectUtil.isNotNull(enabled)|| IteratorUtil.isNotEmpty(createDate);
    }
}

 